package oop2;

/**
 * Created with IntelliJ IDEA.
 * ClassName: Boy
 * Package: oop2
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-11-21
 * Time: 15:08
 */

public class Boy {

    private String name;
    private int age;

    public void marry(Girl girl) {
        System.out.println("我想娶" + girl.getName());
    }

    public void shout() {
        if (age >= 22) {
            System.out.println("终于可以结婚了");
        } else {
            System.out.println("我只能是多谈恋爱了");
        }
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Boy(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Boy() {

    }
}
